from flask import Flask
from flask import render_template, request, redirect, url_for, flash, session
import mysql.connector
import os

app = Flask(__name__)
app.secret_key = os.urandom(24)

# 数据库配置
db_config = {
    'host': 'localhost',
    'user': 'root',
    'password': '123456',
    'database': 'volunteer_platform1'
}

# 数据库连接函数
def get_db_connection():
    return mysql.connector.connect(**db_config)

from app import routes 